<template>
  <el-table :data="tableData" border stripe style="width: 100%">
    <el-table-column prop="sid" label="#" width="180" />
    <el-table-column prop="snm" label="车站名称" width="180" />
    <el-table-column prop="snmpy" label="车站拼音" />
    <el-table-column prop="city" label="所在城市" width="180" />
    <el-table-column prop="citypy" label="城市拼音" />
    <el-table-column fixed="right" label="Operations" width="120">
      <template #default="scope">
        <el-button link type="primary" size="small" @click="handleClick">Detail</el-button>
        <el-button
          link
          type="primary"
          size="small"
          @click="handleEditClick(scope.$index, scope.row)"
          >Edit</el-button
        >
      </template>
    </el-table-column>
  </el-table>
</template>

<script setup>
import { useStationStore } from '../../stores/station'
import { storeToRefs } from 'pinia'
const stationStore = useStationStore()
const handleEditClick = (index, row) => {
  stationStore.preInfo4Mod(index, row)
}

const { tableData } = storeToRefs(stationStore)

const handleClick = () => {
  console.log('click')
}
</script>
